1. Field of the Invention
The present invention generally relates to electronic circuits, and more particularly to comparator circuits having hysteresis.
2. Description of Related Art
A comparator is an electronic device that compares two input voltages or currents, and switches its output between two states to indicate which input is larger. Such a comparator is widely used to determine if an input is above or below a reference voltage. Some comparators have a voltage hysteresis to prevent rapid switching of its output between states as the input drifts around the reference voltage. For example, noise may cause the input to drift around the reference voltage as the input transitions across the reference voltage. A comparator with hysteresis typically switches its output to one state when the input exceeds an upper voltage and to another state when the input falls below a lower voltage. When the input is between the upper voltage and the lower voltage, the comparator does not switch its output.
Although conventional comparators with voltage hysteresis improve noise immunity for low-level noise in an input, unwanted switching may still occur as a result of transitory voltage spikes in the input. Moreover, some conventional comparators do not operate properly when the voltage of the input is near an upper rail (e.g., a supply voltage) or near a lower rail (e.g., a ground potential) of a common mode input voltage range.
In light of the above, a need exists for a comparator with increased noise immunity. A further need exists for a comparator with a rail-to-rail common mode input range.